using System;
using Common.Enumerations;
using Newtonsoft.Json;
using PetaPoco;
using Sanelib.DataView;

namespace Common.Views
{
	[TableName("TaskLogView")]
	public class TaskLogView : AuditedView
	{
	    public Guid? UserId { get; set; }
	    public string MemberCode { get; set; }
	    public string MemberName { get; set; }
	    public DateTime? StartTime { get; set; }
		public DateTime? EndTime { get; set; }

		[JsonIgnore]
		public TaskStatus TaskStatus { get; set; }
		public string TaskStatusValue { get { return TaskStatus == null ? "" : TaskStatus.Value; } set { TaskStatus = TaskStatus.FromValue(value); } }
		public string TaskStatusName { get { return TaskStatus == null ? "" : TaskStatus.DisplayName; } set { TaskStatus = TaskStatus.FromDisplay(value); } }
	}
}
